import { Tools } from 'weaver-mobile';

export const getHearderTab = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getTopTab',
        method: 'GET',
        params,
    });
}

export const getCustomerCard = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getCustomerInfo',
        method: 'GET',
        params,
    });
}

export const setCustomerConcerned = params => {
    return Tools.callApi({
        url: '/api/crm/label/markImportant',
        method: 'GET',
        params,
    });
}

export const getChanceCard = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getChanceInfo',
        method: 'GET',
        params,
    });
}

export const setChanceConcerned = params => {
    return Tools.callApi({
        url: '/api/crm/label/markImportant',
        method: 'GET',
        params,
    });
}

export const getContacterCard = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getContacterInfo',
        method: 'GET',
        params,
    });
}

export const setContacterConcerned = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/markImportant',
        method: 'GET',
        params,
    });
}

export const deleteContacter = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/delete',
        method: 'POST',
        params,
    });
}

export const getContacterForm = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/form?ismobile=1',
        method: 'GET',
        params,
    });
}

export const createContacter = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/create',
        method: 'POST',
        params,
    });
}

export const getChanceForm = params => {
    return Tools.callApi({
        url: '/api/crm/sellchance/form?ismobile=1',
        method: 'GET',
        params,
    });
}

export const createChance = params => {
    return Tools.callApi({
        url: '/api/crm/sellchance/formSave',
        method: 'POST',
        params,
    });
}
export const sellChanceAllEdit = params => {
    return Tools.callApi({
        url: '/api/crm/sellchance/sellChanceAllEdit',
        method: 'POST',
        params,
    });
}
export const updateContacter = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/edit',
        method: 'POST',
        params,
    });
}

export const updateContacterBatch = params => {
    return Tools.callApi({
        url: '/api/crm/contacter/contacterEdit',
        method: 'POST',
        params,
    });
}

export const updateCustomer = params => {
    return Tools.callApi({
        url: '/api/crm/customer/customerEdit',
        method: 'GET',
        params,
    });
}

export const getContactForm = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getContactForm',
        method: 'GET',
        params,
    });
}

export const saveContactForm = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/saveContactForm',
        method: 'POST',
        params,
    });
}

export const getShareListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getShareListResult',
        method: 'GET',
        params,
    });
}

export const getChanceListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getChanceListResult',
        method: 'GET',
        params,
    });
}

export const getContactListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getContactListResult',
        method: 'GET',
        params,
    });
}

export const getContacterListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getContacterListResult',
        method: 'GET',
        params,
    });
}

export const getWorkplanListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getWorkplanListResult',
        method: 'GET',
        params,
    });
}

export const getCustomerListResult = params => {
    return Tools.callApi({
        url: '/api/crm/mobile/getCustomerListResult',
        method: 'GET',
        params,
    });
}
export const getBusinessInfo = params => {   //工商信息
    return Tools.callApi({
        url: '/api/crm/customer/businessInfo',
        method: 'POST',
        params,
    });
}

export const cacheBusinessInfo = params => {   //工商信息  缓存数据
    return Tools.callApi({
        url: '/api/crm/customer/cacheBusinessInfo',
        method: 'POST',
        params
    });
}

export const saveBusinessLog = params => {   //工商信息  保存日志
    return Tools.callApi({
        url: '/api/crm/customer/saveBusinessLog',
        method: 'GET',
        params
    });
}

export const getBusinessLog = params => {   //工商信息  日志列表查询
    return Tools.callApi({
        url: '/api/crm/customer/businessLog',
        method: 'GET',
        params
    });
}

export const signInOut = params => {   //签到签退    
    return Tools.callApi({
        url: '/api/crm/mobile/signInOut',
        method: 'POST',
        params
    });
}

export const deleteShare = params => {   //删除共享
    return Tools.callApi({
        url: '/api/crm/customer/deleteShare',
        method: 'GET',
        params
    });
}

export const addShare = params => {   //客户卡片-添加共享
    return Tools.callApi({
        url: '/api/crm/customer/addShare',
        method: 'GET',
        params
    });
}

export const shareConditions = params => {   //客户卡片-共享表单
    return Tools.callApi({
        url: '/api/crm/customer/ShareConditions',
        method: 'GET',
        params
    });
}

export const changePosition = params => {   //客户卡片-共享表单
    return Tools.callApi({
        url: '/api/crm/customer/changePosition',
        method: 'GET',
        params
    });
}

export const GetCityId = params => {   //新建客户-获取城市id
    return Tools.callApi({
        url: '/api/crm/customer/crmGetCityId',
        method: 'GET',
        params
    });
}

export const deleteWorkPlan = params => {   //删除联系
    return Tools.callApi({
        url: '/api/workplan/base/delete',
        method: 'POST',
        params
    });
}

export const completeWorkPlan = params => {   //完成计划
    return Tools.callApi({
        url: '/api/crm/contactLog/finishWorkPlan',
        method: 'GET',
        params
    });
}

export const customerView = (params) => {       //获取客户查看-编辑表单
    return Tools.callApi({
        url: '/api/crm/customer/customerView',
        method: 'GET',
        params
    });
}

export const saveEdit = (params) => {       //保存编辑后的信息
    return Tools.callApi({
        url: '/api/crm/customer/customerAllEdit',
        method: 'GET',
        params
    });
}

export const crmDelete = (params) => {       //删除客户
    return Tools.callApi({
        url: '/api/crm/customer/crmDelete',
        method: 'GET',
        params
    });
}

export const contacterDelete = (params) => {       //删除联系人
    return Tools.callApi({
        url: '/api/crm/contacter/delete',
        method: 'POST',
        params
    });
}

export const chanceDelete = (params) => {       //删除商机
    return Tools.callApi({
        url: '/api/crm/sellchance/delete',
        method: 'POST',
        params
    });
}

//////////////首页开始

export const getHpSellsInfo = (params) => {       //获取销售简报统计信息
    return Tools.callApi({
        url: '/api/crm/mobile/getHpSellsInfo',
        method: 'POST',
        params
    });
}

export const getHpSellsReportInfo = (params) => {       //获取销售简报图表信息
    return Tools.callApi({
        url: '/api/crm/mobile/getHpSellsReportInfo',
        method: 'POST',
        params
    });
}

export const getHpSellsReportList = (params) => {       //获取销售简报图表下的列表信息
    return Tools.callApi({
        url: '/api/crm/mobile/getHpSellsReportList',
        method: 'GET',
        params
    });
}

export const getContactPlanInfo = (params) => {       //获取拜访计划信息
    return Tools.callApi({
        url: '/api/crm/mobile/getContactPlan',
        method: 'GET',
        params
    });
}

export const getRemindInfo = (params) => {       //获取遗忘客户提醒信息
    return Tools.callApi({
        url: '/api/crm/contactLog/contactLogRemind',
        method: 'GET',
        params
    });
}
////////////首页结束

export const getCircleDot = (params) => {       //删除商机
    return Tools.callApi({
        url: '/api/crm/mobile/getCircleDot',
        method: 'GET',
        params
    });
}
export const getSellChanceAuthorList = (params) => {       
    return Tools.callApi({
        url: '/api/crm/sellchance/auth/getSellChanceAuthorList',
        method: 'GET',
        params
    });
}

export const getChnceShareListResult = (params) => {     
    return Tools.callApi({
        url: '/api/crm/mobile/getChnceShareListResult',
        method: 'GET',
        params
    });
}
export const getCreaterAuthorFormCondition = (params) => {       
    return Tools.callApi({
        url: '/api/crm/sellchance/auth/getCreaterAuthorFormCondition',
        method: 'GET',
        params
    });
}
export const addChanceShare = (params) => {       
    return Tools.callApi({
        url: '/api/crm/sellchance/auth/saveSellChanceAuth',
        method: 'GET',
        params
    });
}
export const deleteSellChanceAuths = (params) => {       
    return Tools.callApi({
        url: '/api/crm/sellchance/auth/deleteSellChanceAuths',
        method: 'GET',
        params
    });
}
export const saveRemarkCmd = params => {   //联系记录评论回复 保存
    return Tools.callApi({ url: '/api/crm/contactlogs/saveRemarkCmd', method: 'GET', params });
}
export const getContactLogsRemark = params => {   //联系记录的所有回复
    return Tools.callApi({ url: '/api/crm/contactlogs/getContactLogsRemark', method: 'GET', params });
}